package com.itic.mall.system.project.interest.service;

import com.itic.appbase.framework.common.service.CrudService;
import com.itic.mall.system.inter.project.interest.persistence.dao.InterestDao;
import com.itic.mall.system.inter.project.interest.persistence.model.Interest;
import com.itic.mall.system.inter.project.interest.persistence.model.InterestExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
@Transactional
public class InterestService
     extends CrudService<InterestDao,Interest,InterestExample> {
    @Autowired
    private InterestDao interestDao;

    public Interest getInterest() {
    	InterestExample example = new InterestExample();
    	List<Interest> interests = this.list(example);
    	if(interests.isEmpty())
    		return null;
    	return interests.get(0);
    }
}